package object;

import java.util.Arrays;

public class Work {
    public static void main(String[] args) {
        //matches
        /*
        String email = "liuy@tedu.cn";
        String regex = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+\\.[a-zA-Z]+";
        boolean match = email.matches(regex);
        if(match){
            System.out.println("是正确的邮箱格式");
        }else {
            System.out.println("不是正确的邮箱格式");

         */
        /*
        String email = "liuy@tedu.cn";
        String regex = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+\\.[a-zA-Z]+";
        boolean match = email.matches(regex);
        if(match){
            System.out.println("是正确的邮箱格式");
        }else {
            System.out.println("不是正确的邮箱格式");
        }

         */

        //replaceAll
        /*
        String line = "abc123def456hjk789";
        line = line.replaceAll("[0-9]+","#NUMBER#");
        System.out.println(line);

         */
        /*
        String line = "asd123qwe456zxc789";
        line = line.replaceAll("[0-9]+","#NUMBER#");
        System.out.println(line);

         */

        //split
        /*
        String line = "abc123asd456qwe";
        String[] data = line.split("[0-9]+");
        System.out.println(Arrays.toString(data));

        line = "123.456.78";
        data = line.split("\\.");
        System.out.println(Arrays.toString(data));

        line = ".123.456..78...........";
        data = line.split("\\.");
        System.out.println(Arrays.toString(data));

         */
        /*
        String line = "asd123qwe456zxc789";
        String[] data = line.split("[0-9]+");
        System.out.println(Arrays.toString(data));

        line = "123.456.78";
        data = line.split("\\.");
        System.out.println(Arrays.toString(data));

        line = ".123.456..78............";
        data = line.split("\\.");
        System.out.println(Arrays.toString(data));

         */

        //Integer
        /*
        Integer i1 = new Integer(5);
        Integer i2 = new Integer(5);
        System.out.println(i1==i2);
        System.out.println(i1.equals(i2));

        Integer i3 = Integer.valueOf(5);
        Integer i4 = Integer.valueOf(5);
        System.out.println(i3==i4);
        System.out.println(i3.equals(i4));

        int i = i4.intValue();
        System.out.println(i);

         */
        /*
        Integer i1 = new Integer(5);
        Integer i2 = new Integer(5);
        System.out.println(i1==i2);
        System.out.println(i1.equals(i2));

        Integer i3 = Integer.valueOf(5);
        Integer i4 = Integer.valueOf(5);
        System.out.println(i3==i4);
        System.out.println(i3.equals(i4));

        int i = i4.intValue();
        System.out.println(i);

         */

        //自动拆装箱
        /*
        Integer i = 5;//装箱
        int j = i;//拆箱

         */
        /*
        Integer i = 5;//装箱
        int j = i;//拆箱

         */

        //包装类的两种常见操作
        /*
        int max = Integer.MAX_VALUE;
        int min = Integer.MIN_VALUE;
        System.out.println("int的最大值为:"+max+",最小值为:"+min);

        long max1 = Long.MAX_VALUE;
        long min1 = Long.MIN_VALUE;
        System.out.println("long的最大值为:"+max1+",最小值为:"+min1);

        String s1 = "18";
        int age = Integer.parseInt(s1);
        System.out.println(age);

        String s2 = "123.456";
        double price = Double.parseDouble(s2);
        System.out.println(price);

         */
        /*
        int max = Integer.MAX_VALUE;
        int min = Integer.MIN_VALUE;
        System.out.println("int的最大值为:"+max+",最小值为:"+min);

        long max1 = Long.MAX_VALUE;
        long min1 = Long.MIN_VALUE;
        System.out.println("long的最大值为:"+max1+",最小值为:"+min1);

        String s1 = "18";
        int age = Integer.parseInt(s1);
        System.out.println(age);

        String s2 = "123.456";
        double price = Double.parseDouble(s2);
        System.out.println(price);

         */


    }
}
